# 异常
# 语法错误、异常
# 语法错误：缩进错误、少写了一个引号、关键字拼写错误......SyntaxError

# 六大常见的异常
# 除零异常
# 10 / 0 # ZeroDivisionError

# 名称异常
# print(a)  # NameError: name 'a' is not defined

# 类型异常
int1 = 10
str1 = '10'

# print(int1 + str1) # TypeError: unsupported operand type(s) for +: 'int' and 'str'

# 值异常
str2 = 'abc'
# int(str2)  # ValueError: invalid literal for int() with base 10: 'abc'

# 索引异常
list1 = [1, 2, 3, 4]
# list1[5]  # IndexError: list index out of range

# 属性异常
tuple1 = (1, 2, 3, 4)
# tuple1.append() # AttributeError: 'tuple' object has no attribute 'append'
